{% load custom_filters %}

<table class="sortable">
	<thead>
		<tr>
			<th>MouseID</th>
			<th>Strain</th>
			<th>Background</th>
			<th>Genotype</th>
			<th>Gender</th>
			<th>Cage</th>
			<th>Rack</th>
			<th>Position</th>
			<th>Backcross</th>
			<th>Generation</th>
			<th>Born</th>
			<th>Age</th>
			<th>Markings</th>
		</tr>
	</thead>
		
	<tbody>
{% for animal in animal_list %}
  <tr
	{% if not animal.Weaned %} class="unweaned" {% endif %}
	{% if animal.male.all %} class="breeder" {% endif %}
	{% if animal.females.all %} class="breeder" {% endif %}
>
			<td><a href = "/mousedb/mouse/{{ animal.id }}">{{ animal.MouseID}}</a></td>
			<td><a href="/mousedb/strain/{{ animal.Strain.Strain_slug }}">{{ animal.Strain }}</a></td>
			<td>{{ animal.Background }}</td>
			<td>{{ animal.Genotype }}</td>
			<td>{{ animal.Gender }}</td>
			<td>{{ animal.Cage }}</td>
			<td>{{ animal.Rack|all_caps }}</td>
			<td>{{ animal.Rack_Position|all_caps }}</td>
			<td>{{ animal.Backcross }}</td>
			<td>{{ animal.Generation }}</td>
			<td>{{ animal.Born }}</td>
			{% if animal.Death %}
				<td id="dead">{{ animal.Death }}</td>
			{% else %}
				<td id="age">{{ animal.Born|timesince }}</td>
			{% endif %}
			<td>{{ animal.Markings }}</td>
		</tr>
{% endfor%}
	</tbody>
</table>
